<?php
include_once './inc/config_inc.php';
include_once './inc/mysql_inc.php';
include_once './inc/tool_inc.php';
$link=connect();
$user_id=is_login($link);


$template['title']='我的学习笔记';
$template['css']=array('style/public.css','style/index.css');
?>
<?php include 'inc/header_inc.php';?>

<!--慢生活-->
<div class="new" style="margin-top: 10px;">欢迎来到我的学习笔记</div>
<?php
$query="select * from note order by sort asc";
$result=execute($link,$query);
$query="update note set times=times+1";
execute($link,$query);

while($data=mysqli_fetch_assoc($result)){
	$data['times']=$data['times']+1;
	$data['title']=nl2br(htmlspecialchars($data['title']));
	$data['content']=nl2br(htmlspecialchars($data['content']));
?>
<div class="article">
	<div id="title">
		<img src="<?php if($data['photo']!=''){echo $data['photo'];}else{echo 'style/3.jpeg';}?>">
		<span>
			<p style="font-size: 18px;font-weight: bold;"><?php echo $data['title'] ?></p>
			<p><?php echo $data['content']?></p>
		</span>
	</div>
	<div id="comment">发布时间: <?php echo $data['create_time'] ?>&nbsp;&nbsp;&nbsp;浏览: <?php echo $data['times'] ?></div>
</div>
<?php } ?>

<?php include 'inc/footer_inc.php';?>